<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/WEB-INF/jsp/hadmin/commonHeader.jsp" %>
	<script src="./js/jQuery.md5.js" type="text/javascript"></script>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <script type="text/javascript">
	var clickable = true;
	function login() {
		var nickName = $("#nickName").val();
		if (isObjNull(nickName)) {
			alert("用户名不能为空！！");
			return false;
		}
		
		var pwd = $("#password").val();
		if (isObjNull(pwd)) {
			alert("密码不能为空！！");
			return false;
		}
		var password = $.md5(pwd);
		/* var securityCode = $("#securityCode").val();
		if (isObjNull(securityCode)) {
			alert("验证码不能为空！！");
			return false;
		} */
		$("#submitButton").attr("disabled","disabled");
		$.ajax({
			type : "post",
			url : "${ctx}<st:config key='site.adminPostLoginPath' />",
			dataType : 'json',
			data : {
				"password" : password,
				"nickName" : nickName,
				"ajax":1
			},
			success : function(json) {
				if (json.statusCode == 0) {
					window.location.href = "./hadmin/index.act";
				} else {
					//alert(json.message);
				}
				$("#submitButton").removeAttr("disabled");
			},
			fail:function(){
				$("#submitButton").removeAttr("disabled");
			}
		});
		return false;
	}
</script>
</head>

<body class="gray-bg">

    <div class="middle-box text-center loginscreen  animated fadeInDown">
        <div>
            <div>

                <h3 style="font-size: 60px;" class="logo-name">登&nbsp;录</h3>

            </div>
            <h3>欢迎使用 <st:config key="companyName"/></h3>

            <form onsubmit="return login();" class="m-t" role="form" >
                <div class="form-group">
                    <input id="nickName" type="text" class="form-control" placeholder="用户名" required="">
                </div>
                <div class="form-group">
                    <input id="password" type="password" class="form-control" placeholder="密码" required="">
                </div>
                <button id="submitButton" type="submit" class="btn btn-primary block full-width m-b">登 录</button>


               <!--  <p class="text-muted text-center"> <a href="login.html#"><small>忘记密码了？</small></a> | <a href="register.html">注册一个新账号</a>
                </p> -->

            </form>
        </div>
    </div>

</body>

</html>
